Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[commands] Fix C++ iterator invalidation bug #7554

Merged
merged 9 commits into from
Dec 20, 2024

Conversation

kytpbs
Copy link
Contributor

@kytpbs kytpbs commented Dec 16, 2024

Because of the huge impact changing the Java Command Scheduler code has, this draft PR removes all the changes made to the Java side and only includes the changes made to C++ from the #6593 PR.

This is still being discussed in the FRC Discord server

kytpbs and others added 8 commits December 16, 2024 18:20
Based on the robot.py commandScheduler implementation.

This way we avoid an iterator invalidation bug when a command ends and we delete it. Because we are only copying a stack(most probably) pointer array, it shouldn't have a big impact on performance.
@github-actions github-actions bot added the component: command-based WPILib Command Based Library label Dec 16, 2024
@kytpbs kytpbs marked this pull request as ready for review December 19, 2024 17:22
@kytpbs kytpbs requested a review from a team as a code owner December 19, 2024 17:22
@PeterJohnson PeterJohnson changed the title Change Command Scheduler to fix iterator invalidation bug in C++ Command Scheduler (Reduced Copy of PR #6593) [commands] Fix C++ iterator invalidation bug Dec 20, 2024
@PeterJohnson PeterJohnson merged commit 807dffe into wpilibsuite:main Dec 20, 2024
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: command-based WPILib Command Based Library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants